package com.yanqu.road.server.cmd.activity.recallplayer;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.RecallPlayerProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.utils.YanQuMessageUtils;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = CrossProtocol.C_PLAYER_RECALL_BIND_RESP ,desc = "活跃玩家返回绑定结果给跨服")
public class CrossPlayerRecallBindRespCmd implements Command {
    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        RecallPlayerProto.WriteRecallCodeServerRespCrossMsg respMsg = RecallPlayerProto.WriteRecallCodeServerRespCrossMsg.parseFrom(packet.getBytes());
        YanQuMessage message = YanQuMessageUtils.buildMessage(GameProtocol.S_RECALL_PLAYER_CROSS_BIND_RESP, respMsg);
        MessageHelper.sendPacket(respMsg.getRespServerId(), respMsg.getRespUserId(), message);
    }
}
